<% present entry do |entry_presenter| %>
  <div class="tweet-wrap" data-behavior="external_links">
    <%= render partial: "shared/tweet", locals: {entry: entry, tweet: entry.tweet.main_tweet, css: "main-tweet entry-main-tweet"} %>

    <% if entry.tweet.retweeted_status? %>
      <div class="tweet-meta-wrap">
        <p class="tweet-meta">
          <a href="<%= entry.tweet.uri.to_s %>">
            <%= image_tag_with_fallback(image_url("favicon-profile-default.png"), entry_presenter.tweet_retweeted_image, size: "16x16", alt: "") %>
            <%= entry_presenter.tweet_retweeted_message %>
          </a>
        </p>
      </div>
    <% end %>

    <% if entry_presenter.quoted_status? %>
      <%= render partial: "shared/tweet", locals: {entry: entry, tweet: entry_presenter.quoted_status, css: "quoted-tweet"} %>
    <% end %>

    <% entry_presenter.tweet_media.each do |media| %>
      <% if entry_presenter.tweet_video?(media) %>
        <%= entry_presenter.tweet_video(media) %>
      <% else %>
        <%= link_to media.media_url_https.to_s + ":4096x4096" do %>
          <%= image_tag camo_link(media.media_url_https.to_s + ":large"), class: "responsive full-width-candidate" %>
        <% end %>
      <% end %>
    <% end %>

    <% entry.tweet_thread.each do |thread| %>
      <%= entry_presenter.tweet_text(thread) %>
      <% thread.media.each do |media| %>
        <% if entry_presenter.tweet_video?(media) %>
          <%= entry_presenter.tweet_video(media) %>
        <% else %>
          <%= link_to media.media_url_https.to_s + ":4096x4096" do %>
            <%= image_tag camo_link(media.media_url_https.to_s + ":large"), class: "responsive full-width-candidate" %>
          <% end %>
        <% end %>
      <% end %>
      <% thread.urls.each do |url| %>
        <% if entry_presenter.youtube_embed(url.expanded_url, :div) %>
          <p><%= entry_presenter.youtube_embed(url.expanded_url, :div) %></p>
        <% elsif entry_presenter.vimeo_embed(url.expanded_url, :div) %>
          <%= entry_presenter.vimeo_embed(url.expanded_url, :div) %>
        <% elsif entry_presenter.instagram_embed(url.expanded_url) %>
          <%= entry_presenter.instagram_embed(url.expanded_url) %>
        <% end %>
      <% end %>
    <% end %>

    <% entry_presenter.tweet_urls.each do |url| %>
      <%= render partial: "shared/link_embed", locals: {url: url.expanded_url, entry: entry} %>
    <% end %>
  </div>
<% end %>